package club.kingyin.commons.enums;

import com.baomidou.mybatisplus.annotation.IEnum;

public enum BlogEnum implements IEnum<Integer> {

    DELETE(-1,"删除"),NORMAL(0,"正常"),
    MAN(1,"男"),WOMAN(2,"女"),
    DRAFT(3,"草稿"),RELEASE(4,"发布"),
    TOP(13,"置顶"),SELF(14,"自己"),
    UNREAD(18,"未读"),READ(17,"已读"),
    SHARE(15,"分享"),NOT_SHARE(16,"取消分享"),
    CONCERNED(5,"已关注"),BE_CONCERNED(6,"被关注"),
    CLOSELY(7,"互相关注"),BLOCK(8,"黑名单"),MAIL(12,"邮箱未验证"),
    USER(9,"普通用户"),ADMIN(10,"管理员"),ROOT(11,"超级用户"),
    TITLED(19,"封号"),UNDERFRAME(20,"下架"),DOCUMENT(21,"文章"),
    MESSAGE(22,"消息");

    BlogEnum(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static BlogEnum deBlogEnum(String blogEnum) {
        switch (blogEnum) {
            case "DOCUMENT":
            case "文章":
                return BlogEnum.DOCUMENT;
            case "MESSAGE":
            case "消息":
                return BlogEnum.MESSAGE;
            case "UNDERFRAME":
            case "下架":
                return BlogEnum.UNDERFRAME;
            case "ROOT":
            case "超级用户":
                return BlogEnum.ROOT;
            case "ADMIN":
            case "管理员":
                return BlogEnum.ADMIN;
            case "USER":
            case "普通用户":
                return BlogEnum.USER;
            case "MAIL":
            case "邮箱未验证":
                return BlogEnum.MAIL;
            case "BLOCK":
            case "黑名单":
                return BlogEnum.BLOCK;
            case "CLOSELY":
            case "互相关注":
                return BlogEnum.CLOSELY;
            case "BE_CONCERNED":
            case "被关注":
                return BlogEnum.BE_CONCERNED;
            case "CONCERNED":
            case "已关注":
                return BlogEnum.CONCERNED;
            case "NOT_SHARE":
            case "取消分享":
                return BlogEnum.NOT_SHARE;
            case "SHARE":
            case "分享":
                return BlogEnum.SHARE;
            case "READ":
            case "已读":
                return BlogEnum.READ;
            case "UNREAD":
            case "未读":
                return BlogEnum.UNREAD;
            case "SELF":
            case "自己":
                return BlogEnum.SELF;
            case "TOP":
            case "置顶":
                return BlogEnum.TOP;
            case "RELEASE":
            case "发布":
                return BlogEnum.RELEASE;
            case "DRAFT":
            case "草稿":
                return BlogEnum.DRAFT;
            case "WOMAN":
            case "女":
                return BlogEnum.WOMAN;
            case "MAN":
            case "男":
                return BlogEnum.MAN;
            case "NORMAL":
            case "正常":
                return BlogEnum.NORMAL;
            case "DELETE":
            case "删除":
                return BlogEnum.DELETE;
        }
        return null;
    }

    public String getDesc() {
        return desc;
    }

    private final int value;
    private final String desc;

    @Override
    public Integer getValue() {
        return value;
    }
}
